<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script>
    var performanceS = function (salary) {
        return salary*4;
    }
    var performanceA = function (salary) {
        return salary*3
    }
    var performanceB = function (salary) {
        return salary*2
    }

    var calculateBonus = function (perfoemanceLevel, salary) {
        if(perfoemanceLevel === 'S'){
            return performanceS(salary)
        }
        if(perfoemanceLevel === 'A'){
            return performanceA(salary)
        }
        if(perfoemanceLevel === 'B'){
            return performanceB(salary)
        }
    }

    console.log(calculateBonus('A',10000));

</script>
</body>
</html>